const port = process.env.port || process.env.npm_config_port || 8100

module.exports = {
  outputDir: 'videoconferencing',
  runtimeCompiler: true,
  productionSourceMap: false,
  devServer: {
    port: port,
    open: true,
    proxy: {
      '/api': {
        target: 'https://links.baibaoyun.net/data/report_card_list',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  css: {
    loaderOptions: {
      sass: {
        prependData: `
          @import "@/styles/variables.scss";
        `
      }
    }
  },
  configureWebpack: {
    externals: {
      XChatKit: 'XChatKit'
    }
  }
  // chainWebpack: (config) => {
  //   config.module.rule('images')
  //     .test(/\.(png|jpe?g|JPG|gif|svg)(\?.*)?$/)
  //     .use('url-loader')
  //     .loader('url-loader')
  // }
}
